package org.jypj.dev.controller;

import javax.servlet.http.HttpServletResponse;

import org.jypj.dev.util.ImageUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value="downloadController")
public class DownloadController {

	
	
	@RequestMapping("downloadMp3.action")
	public void downloadMp3(HttpServletResponse response, String mp3Path){
		ImageUtil.downloadImage(response, System.currentTimeMillis()+".mp3", mp3Path);
	}
	
	/**
	 * 下载图片
	 * @param fileName
	 */
	@RequestMapping("downloadImage.action")
	public void downloadImage(HttpServletResponse response, String imagePath,String fileType) {
		ImageUtil.downloadImage(response, System.currentTimeMillis()+"."+fileType, imagePath);
	}
}
